package org.zp.service;



import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.zp.mapper.UserInfoMapper;
import org.zp.pojo.UserInfo;

@Service
@Transactional(rollbackFor = Exception.class)//出现异常就回滚事务
public class UserServiceimpl implements UserService{
	@Resource
	private UserInfoMapper user;
	

	@Override
	public UserInfo mybatisDoLogin(String name, String pwd) {
		return user.selecUser(name, pwd);
	}

	@Override
	public Integer mybatisAddUser(UserInfo u) {
		return user.insertUser(u);
	}

	@Override
	public UserInfo getUserByuid(Integer uid) {
		// TODO Auto-generated method stub
		return user.getUserByuid(uid);
	}
//
//	@Override
//	public Integer updateUserScore(Integer score, Integer userid) {
//		// TODO Auto-generated method stub
//		return user.updateUserScore(score,userid);
//	}

	@Override
	public Integer updateUserInfo(UserInfo u) {
		// TODO Auto-generated method stub
		return user.updateUserInfo(u);
	}

	@Override
	public Integer useraddMoney(Integer uid, Integer money) {
		// TODO Auto-generated method stub
		return user.useraddMoney(uid,money);
	}

	@Override
	public Integer updateUserAddressInfo(UserInfo use) {
		// TODO Auto-generated method stub
		return user.updateUserAddressInfo(use);
	}

	@Override
	public Integer inserthistory(UserInfo use, Integer eid) {
		// TODO Auto-generated method stub
		return user.inserthistory(use,eid);
	}

	

}
